package com.guodexian.advice;

import com.guodexian.ex.BaseBusinessException;
import com.guodexian.vo.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 类说明：<br>
 *
 * @author qfrx<br>
 * 2024/12/26 11:34<br>
 * @since 1.0 <br>
 */
@ControllerAdvice
public class GlobalExceptionHandler {
    @ExceptionHandler(BaseBusinessException.class)
    @ResponseBody
    public R<BaseBusinessException> processException(BaseBusinessException e) {
        return R.FAIL.setMsg(e.getMessage());
    }
}
